<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@taglib uri="/WEB-INF/tld/pageutil.tld" prefix="pu"%>
<%@taglib uri="/WEB-INF/tld/pageable.tld" prefix="pageable"%>
<%@taglib uri="http://java.sun.com/jstl/fmt_rt" prefix="fmt-rt"%>
<%@taglib uri="http://java.sun.com/jstl/core_rt" prefix="c-rt"%>
<%@	page import="com.yaodian100.core.common.utils.ServerValue"%>
<c-rt:set var="midContextPath" value='<%=ServerValue.getMidContextPath()%>'/>
<c-rt:set var="tp" value="${pu:pageableTag('tpp', 10, 10)}"/>
<c-rt:set var="hql">
from Orders  where memberId = ? and to_char(orderDt,'yyyy-MM-dd') >= ? and to_char(orderDt,'yyyy-MM-dd') <= ? order by orderDt desc
</c-rt:set>
<c-rt:set var="params" value="${pu:addToList('paras', param.memberId)}"/>
<c-rt:set var="params" value="${pu:addToList('paras', startDate)}"/>
<c-rt:set var="params" value="${pu:addToList('paras', endDate)}"/>
<c-rt:set var="orders" value="${pu:queryByHql(hql, params, tp)}"/>

<s:actionerror />
<s:actionmessage />
<s:fielderror />
<script src="/js/jquery.tooltip.min.js" type="text/javascript"></script>
<link rel="stylesheet" href="/css/jquery.tooltip.css" />
<script type="text/javascript">
<!--
	$().ready(function(){
		$("tr.tdDesc").tooltip();
	});
//-->
</script>
<input type="hidden" name="memberId" value="${memberId}"/>
<input type="hidden" name="tabsId" value="${tabsId}"/>
<table class="tb-1" width="100%">
	<thead>
		<tr>
			<th>订单号</th>
			<th>订购日期</th>
			<th>订单状态<BR>
			付款状态</th>
			<th>付款方式</th>
			<th>购买商品</th>
			<th>总价</th>
			<th>订购人</th>
		</tr>
	</thead>
	<tbody>
		<c-rt:forEach items="${orders}" var="orders" varStatus="rows_index">
			<tr class="${rows_index.count % 2 == 0 ? 'bg-yl' : ''} tdDesc" id="tdDesc" title="订单编号:${orders.orderId}<BR>手机:${orders.receiverMobile}<BR>固定:${orders.receiverPhoneArea}-${orders.receiverPhone}-${orders.receiverExt}<BR>地址:${orders.receiverZip}${orders.receiverProvince}${orders.receiverCity}${orders.receiverArea}${orders.receiverAddr}">
				<td><a href="${midContextPath}/order/view.do?orderId=${orders.orderId}">${orders.orderId}</a></td>
				<td><fmt-rt:formatDate value="${orders.orderDt}"
					pattern="yyyy-MM-dd HH:mm:ss" /></td>
				<td>${orderStMenu.options[orders.orderSt].name}<BR>
				${paymentStMenu.options[orders.paymentSt].name}</td>
				<td>${paymentTpMenu.options[orders.paymentTp].name}</td>
				<td><c-rt:forEach items="${orders.orderProduct}" var="oproduct"
					varStatus="rowdetail_index">
				${rowdetail_index.count > 1 ? '<BR>' : ''}${oproduct.prodName}${oproduct.prodSpecName}
				(${oproduct.qty}X${oproduct.unitPrice}=${oproduct.amount})${logisticStMenu.options[oproduct.logisticSt].name}
				<c-rt:if test="${oproduct.returnQty > 0}">
						<BR>
						<B><font color=#ff3300>退:${oproduct.returnQty}\
						${returnStMenu.options[oproduct.returnSt].name}</font></B>
					</c-rt:if>
				</c-rt:forEach></td>
				<td>${orders.amount}</td>
				<td>${orders.memberName}</td>
			</tr>
		</c-rt:forEach>
	</tbody>
</table>
<pageable:Pageable url="${midContextPath}/member/searchOrders.do" escapeparams="AJAX,refreshZone" parameter="AJAX=true&refreshZone=${tabsId}" formname="${pageFormname}" key="tpp"></pageable:Pageable>
